1. Field of Invention
The present invention relates generally to synchronization of media streams, and more specifically to utilizing clocks on multiple media devices and on a single host to synchronize multiple media streams.
2. Background of Invention
In a multimedia environment, it is often necessary to synchronize multiple streams of data (e.g., a video stream and an audio stream). Although synchronizing video with audio is a common example, such a challenge occurs whenever it is desired to simultaneously output at least two streams of data of any type that is metered by time. Although it is desirable to start each stream at the same time, simply simultaneously sending each media stream to its physical output hardware will not necessarily ensure synchronization. Physical output devices typically have constraints binding available output start times. For example, a video output device can only begin outputting received data at the beginning of a vertical synchronization cycle. Other devices such as audio are somewhat more flexible, but still have some inherent latency between the time data is received and the subsequent output time. Latency and constraints on possible output start times are a function of the specific hardware, and thus vary a great deal, not only between media types, but also from device to device.
When the video and audio streams are output by a common device, synchronization can be achieved by the associated device driver delaying the audio output until a vertical synchronization cycle begins, adjusted for the time of the audio output latency. However, this solution only works for a single device. The synchronizing device driver is not aware of other output devices, and the other output devices and their controlling software have no information concerning the operations of the synchronizing device driver.
What is needed are methods, systems and computer program products that synchronize multiple media streams, even where the media streams are processed by separate devices.